package io.xxx.xbutler.common;

import java.time.LocalDate;

import static io.xxx.xbutler.constant.Formats.COMPACT_DATE_FORMATTER;

public interface RedisKeys {

    /**
     * 门店读取到的顾客最爱数据（100条）
     */
    static String favoriteProducts(Long storeId, LocalDate date) {
        return "storeFavoriteProducts:" + storeId + ":" + date.format(COMPACT_DATE_FORMATTER);
    }

    /**
     * 门店已经使用过的红包
     */
    static String storeCurrentUsedRedEnvelope(Long storeId, LocalDate date) {
        return "storeCurrentUsedRedEnvelope:" + storeId + ":" + date.format(COMPACT_DATE_FORMATTER);
    }

    /**
     * 门店当前使用的红包，红包最长期限为30天
     */
    static String storeUsedRedEnvelopes(Long storeId) {
        return "storeUsedRedEnvelopes:" + storeId;
    }

    /**
     * 红包信息
     */
    static String redEnvelope(Long redEnvelopeId) {
        return "redEnvelope:" + redEnvelopeId;
    }

    /**
     * 已推送的任务明细数量
     */
    static String taskReceiverPushedCount(Long taskId, LocalDate date) {
        return "taskReceiverPushedCount:" + taskId + ":" + date.format(COMPACT_DATE_FORMATTER);
    }

    /**
     * 门店当天已下单的用户，包含虚拟用户。
     * true - 真实用户
     * false - 虚拟用户
     */
    static String storePrimeDayOrderUsers(Long storeId, LocalDate date) {
        return "storePrimeDayOrderUsers:" + storeId + ":" + date.format(COMPACT_DATE_FORMATTER);
    }

    /**
     * 小程序已推送数量
     */
    static String miniProgramPushedQuantity(Long storeId, LocalDate date) {
        return "miniProgramPushQuantity:" + storeId + ":" + date.format(COMPACT_DATE_FORMATTER);
    }

    /**
     * 推送成功的数量（set）
     */
    static String pushSuccessPushRecords(Long taskId) {
        return "pushSuccessTaskReceivers:" + taskId;
    }

    /**
     * 推送失败的数量（set）
     */
    static String pushFailPushRecords(Long taskId) {
        return "pushFailTaskReceivers:" + taskId;
    }

    /**
     * 分页获取商家机器人详情列表的maxId
     */
    static String queryRobotsMaxId(String merchantNo) {
        return "queryRobotsMaxId:" + merchantNo;
    }

    static String applyRobotLock(Long storeId) {
        return "applyRobotLock:" + storeId;
    }
}
